package com.lifa.controller;


import com.lifa.dao.YuangongtchuizongDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/Yuangong")
@Scope("prototype")
public class YuangongtchuizongController {
    @Autowired
    private YuangongtchuizongDao yuangongtchuizongDao;




    @RequestMapping("/yghz")
    @ResponseBody
    public Map<String,Object> yuangong(String dianpu_Name, int offset, int limit){
        Map<String,Object> map = new HashMap<String, Object>();

        //System.out.print(id);
        map.put("rows",yuangongtchuizongDao.query(dianpu_Name,offset,limit));
        map.put("total",yuangongtchuizongDao.getTotalCount(dianpu_Name));
        return map;
    }

}
